# 元素去重
list_my = [2, 3, 8, 3, 2, 4, 5, 6, 7, 7, 7, 4, 4, 5, 6]
# 利用集合的唯一性去重
print(list(set(list_my)))

print('===========================')
# 利用迭代加判断去重
def getnum(list_my):
    temp = []
    for i in list_my:
        # if i not in temp:
        #     temp.append(i)
        temp.append(i) if i not in temp else temp
    return temp

print(getnum(list_my))
